'''
Created on Aug 24, 2011

@author: david
'''
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import logging
class Server(object):
    
    def __init__(self,applets,debug=True):
        self._applets = applets
        self._debug = debug
        logging.info("-- Server initialized")
        
    def run(self):
        # create web app from handler       
        wa = webapp.WSGIApplication(self._applets,debug=self._debug)
    
        logging.info("-- starting server")
        # and run it
        run_wsgi_app(wa)
    
    